{% extends "base.html" %}

{% block content %}
<h1>{{ title }}</h1>

{% if user.is_authenticated %}
	<form id="profile_form" name="profile_form">
		<table>
			{% for field in form %}
	        <tr>
	        	<td><b>{{ field.label_tag }}:</b></td>        	
	          	<td style="padding-left:5px">{{ field.value }}{% if field.errors %} <strong>{{ field.errors }}</strong>{% endif %}</td>
	        </tr>
			{% endfor %}
		</table>
	</form><br>
	<table><tr>
				<td>
					<form name='change_profile' action="/change_profile">
					<input type="submit" value="Change user data">
					</form>
				</td>
				<td>
					<form name='change_pw' action="/change_pw">
						<input type="submit" value="Change Password">
					</form>
				</td>
	</tr></table>
{% else %}
	<p>
		<strong>Sorry but you are not logged in! 
		<a href="/login">Login</a> before you acces your profile page!</strong>
	</p>
{% endif %}
{% endblock %}